package lab03.Test07;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

/**
 * Created by lenovo on 2017/12/12.
 */
public class test {public static void main(String[] args) {
    //7、	读取book.zip,并将book.zip中含有的文件重新存放到当前目录中的book文件夹中，
    // 即将book.zip的内容解压到book文件夹中。

    String path = "D:\\hello.zip ";
    ZipInputStream zipInputStream = null;
    try {
        zipInputStream = new ZipInputStream(new FileInputStream(path));

        ZipEntry entry;
        while ((entry = zipInputStream.getNextEntry())!= null){
            System.out.println(entry.getName());
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    finally {

    }
}
}
